From: Thomas Sanders Date: Tue, 14 Mar 2017 12:15:52 +0000 (+0000) Subject: oxenstored: comments explaining some variables X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2392^2~12 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=312d362398036cb4204330ef1cbf5f48ed9dfe05;p=xen.git oxenstored: comments explaining some variables It took a while of reading and reasoning to work out what these are for, so here are comments to make life easier for everyone reading this code in future. Signed-off-by: Thomas Sanders Reviewed-by: Jonathan Davies Reviewed-by: Ian Jackson Reviewed-by: Christian Lindig --- diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml index 223ee21ebb..9f619b8fd5 100644 --- a/tools/ocaml/xenstored/store.ml +++ b/tools/ocaml/xenstored/store.ml @@ -211,6 +211,7 @@ let apply rnode path fct = lookup rnode path fct end +(* The Store.t type *) type t = { mutable stat_transaction_coalesce: int; diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml index 6b37fc2ad0..51d5d6a404 100644 --- a/tools/ocaml/xenstored/transaction.ml +++ b/tools/ocaml/xenstored/transaction.ml @@ -69,11 +69,15 @@ let can_coalesce oldroot currentroot path = else false -type ty = No | Full of (int * Store.Node.t * Store.t) +type ty = No | Full of ( + int * (* Transaction id *) + Store.Node.t * (* Original root *) + Store.t (* A pointer to the canonical store: its root changes on each transaction-commit *) +) type t = { ty: ty; - store: Store.t; + store: Store.t; (* This is the store that we change in write operations. *) quota: Quota.t; mutable paths: (Xenbus.Xb.Op.operation * Store.Path.t) list; mutable operations: (Packet.request * Packet.response) list; @@ -155,7 +159,7 @@ let commit ~con t = let has_commited = match t.ty with | No -> true - | Full (id, oldroot, cstore) -> + | Full (id, oldroot, cstore) -> (* "cstore" meaning current canonical store *) let commit_partial oldroot cstore store = (* get the lowest path of the query and verify that it hasn't been modified by others transactions. *)